<?php

namespace IDock\Insurance\JTIC\Response;

use IDock\Http\Response;
use IDock\IDock\IDockEnums;
use IDock\Insurance\DBIC\DBICEnums;
use IDock\Printer\VehicleModelPrinter;
use IDock\Printer\VehiclePrinter;

class ConfigInquiryResponse extends AllJTICResponse
{

    /**
     * 基本信息
     * @var  $motorUsageTypeCode
     */
    public $motorUsageTypeCode;

    /**
     * 出单账号列表
     * @var  $dotEmpList
     */
    public $dotEmpList;

    /**
     * 车险产品组列表
     * @var  $prodGroupList
     */
    public $prodGroupList;

    /**
     * 意健险方案列表
     * @var  $projectACCList
     */
    public $projectACCList;

    /**
     * 财产险方案列表
     * @var  $projectPROPList
     */
    public $projectPROPList;


    public function printerInit(): Response
    {
        $this->motorUsageTypeCode = $this->get('BasePart',[])['MotorUsageTypeCode'] ?? '';
        if($this->motorUsageTypeCode) {
            $this->motorUsageTypeCode = explode(',',$this->motorUsageTypeCode);
        }

        $this->dotEmpList = $this->get('DotEmpList',[])['DotEmpItem'] ?? '';

        $this->prodGroupList = $this->get('ProdGroupList',[])['ProdGroupItem'] ?? [];

        $this->projectACCList = $this->get('ProjectACCList',[])['ProjectItem'] ?? [];
        $this->projectACCList = $this->get('ProjectPROPList',[])['ProjectItem'] ?? [];

        return $this;
    }
}
